<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>计划任务 Schedule Form</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/statics/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/statics/style/admin.css}" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-task" id="layuiadmin-form-task" style="padding: 20px;">
    <div class="layui-form-item">
        <label class="layui-form-label">任务名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入任务名称"
                   class="layui-input" th:value="${task.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">组名称</label>
        <div class="layui-input-block">
            <input type="text" name="group" lay-verify="required" autocomplete="off" placeholder="请输入组名称"
                   class="layui-input" th:value="${task.group}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">类名</label>
        <div class="layui-input-inline">
            <input type="text" name="className" lay-verify="required" autocomplete="off" placeholder="请输入类名"
                   class="layui-input" th:value="${task.className}">
        </div>
        <div class="layui-input-inline">
            <input type="text" name="methodName" lay-verify="required" autocomplete="off" placeholder="请输入方法名"
                   class="layui-input" th:value="${task.methodName}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">Spring ID</label>
        <div class="layui-input-block">
            <input type="text" name="springId" autocomplete="off" placeholder="请输入类名"
                   class="layui-input" th:value="${task.springId}">
        </div>
    </div>
   <div class="layui-form-item">
        <label class="layui-form-label">表达式</label>
        <div class="layui-input-block">
            <input type="text" name="cron" autocomplete="off" placeholder="请输入表达式" class="layui-input"
                   th:value="${task.cron}"/>
            <div class="layui-form-mid layui-word-aux">请填写<a href="http://cron.qqe2.com" style="color: #1E9FFF;" target="_blank">CRON表达式</a>;</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开始时间</label>
        <div class="layui-input-block">
            <input type="text" name="startTime" autocomplete="off" placeholder="请输入开始时间" lay-verify="datetime" readonly
                   class="layui-input datetime" th:value="${#dates.format(task.startTime,'yyyy-MM-dd HH:mm:ss')}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="description" placeholder="请输入内容" class="layui-textarea" th:text="${task.description}"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否并发</label>
        <div class="layui-input-block">
            <input type="checkbox" name="isConcurrent" lay-skin="switch" lay-text="是|否" th:checked="${task.isConcurrent == 1}"/>

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="运行" th:field="${task.status}"/>
            <input type="radio" name="status" value="0" title="停止" th:field="${task.status}"/>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" th:value="${task.id}"/>
        <button class="layui-btn" lay-submit lay-filter="LAY-task-add-submit" id="LAY-task-add-submit">提交</button>
    </div>
</div>
<script th:src="@{/statics/layui/layui.js}"></script>
<script>
    layui.config({
        base: '/statics/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form' , 'laydate'], function () {
        var $ = layui.$
            ,laydate = layui.laydate
            , form = layui.form;

        laydate.render({
            elem: '.datetime'
            ,type: 'datetime'
        });

    })
</script>
</body>
</html>